<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/tlds/fmt.tld" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/tlds/oscache.tld" prefix="oscache"%>
<%@ page import="java.util.*"%>
<%@ page import="com.gzgi.framework.*"%>
<%@ page import="com.gzgi.framework.todo.*"%>
<%@ page import="com.gzgi.framework.util.*"%>
<%@ page import="org.apache.commons.lang.StringUtils"%>
<%
    String context = request.getContextPath();
	TodoHelper todoHelper = new TodoHelper();
	String actorId = (String)request.getSession().getAttribute(SecurityContext.LOGIN_ACTOR_ID); 
	if(actorId == null){
		return;
	}
    Collection rows = todoHelper.getJbpmTasks(actorId);
	//Collection rows = todoHelper.getTasks(actorId);
	//System.out.println("###########################"+rows.size());
%>
<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/pages/styles/styles.css" />
<style type="text/css">
.todo_title {
	position: absolute;
	top: 0;
	left: 0;
	background: url(../images/todo_title.gif) no-repeat;
	width: 55px;
	height: 15px;
}
</style>
<div class="todo">
<div align="left" width="98%">
<div align="left"></div>
</div>
<div>
<table width="98%" border="0" cellspacing="1" cellpadding="0"	class="list-box">
	<tr class="list-title">
		<td align="center"><b>事&nbsp;&nbsp;项</b></td>
		<td width="95" align="center"><b>PastDue</b></td>
		<td width="95" align="center"><b>Caution</b></td>
		<td width="95" align="center"><b>OK</b></td>
	</tr>
	<%if(rows != null && rows.size()> 0){
		      Map paramMap = new HashMap();
			  Iterator iterator008 = rows.iterator();
			  while(iterator008.hasNext()){
	               Todo xx = (Todo) iterator008.next();
				   pageContext.setAttribute("todo", xx);
				   paramMap.clear();
				   paramMap.put("processName", xx.getProcessName());	
				   paramMap.put("taskName", xx.getTaskName());	
				   int okQty = xx.getOk().size();
				   int cautionQty = xx.getCaution().size();
				   int pastDueQty = xx.getPastDue().size();
                   String x_complex_query = JSONTools.encode(paramMap);
                   x_complex_query = RequestUtil.encodeString(x_complex_query);
			  %>
	<tr class="list-a">
		<td height="20" align="left"><a
			href="<%=context%><c:out value="${todo.listLink}" escapeXml="true"/>&todoId=<c:out value="${todo.id}"/>&task=<c:out value="${todo.taskName}"/>&x_rowIds=<c:out value="${todo.allBuffer}"/>&x_complex_query=<%=x_complex_query%>"
			title="<c:out value="${todo.title}"/>   <c:out value="${todo.content}"/>" target="_blank"> <c:out value="${todo.title}" /> </a>
		</td>
		<td width="80" align="center" class="red"><%=pastDueQty%></td>
		<td width="80" align="center" class="yellow"><%=cautionQty%></td>
		<td width="80" align="center" class="green"><%=okQty%></td>
	</tr>
	<%     }
		  }
	%>
</table>
</div>
</div>